package com.nulldev.util.concurrency.threadIt.v4.emapi.testing;

import com.nulldev.util.JVM.JVM;
import com.nulldev.util.concurrency.threadIt.v4.emapi.ExecutorManager;
import com.nulldev.util.concurrency.threadIt.v4.emapi.uft.Executable;

public class BadCodeDeadlock {

	public static void main(String[] args) {
		try {
			final Executable<?> e = ExecutorManager.globalAsyncSubmit(() -> {
				return 5;
			});
			final Executable<?> o = ExecutorManager.globalAsyncSubmit(() -> {
				return e.waitTillCompletion();
			});
			JVM.println(o.waitTillCompletion());
		} catch (Exception e) {
			JVM.errorln(e);
		}
	}

}
